﻿/**	@file		shader_loader.h
 *	@date		(2007-05-18 00:32:19)/(2010-12-06 22:28:36)
 *-----------------------------------------------------------------------------
 *	@version	1.0.8.11
 *	@author		Nick Shallery	(nicknide@gmail.com)
 *	@copyright	YOU HAVE ALL LEFT WITH THIS CODE WHILE YOU KEEP COMMENT IN EVERY COPY.
 *-----------------------------------------------------------------------------
**/

#if			!defined(__LXUT__MOD_SHADER_LOADER__NICK__K_IN_G__)
#define		__LXUT__MOD_SHADER_LOADER__NICK__K_IN_G__
//==============================================================================
//--------------------------------------------------------------------------
#if			!defined(__LOLIX__LOLIX_TYPE__K_IN_G__)
	#include	"../../lolix/lolix_type.h"
#endif	//	!defined(__LOLIX__LOLIX_TYPE__K_IN_G__)

namespace lolix{
	namespace loli{
		class	file_block;
		class	file_tree;
	}
	namespace pretty{
		class	render_material;
	}
}

namespace lxut{namespace mod{

class	LOLIX_NO_VTABLE	shader_loader
	: public lolix::itf
{
public:
	LOLIX_DEFINE_FACTORY((0x7f68c143, 0xbd4349e6, 0x8bb3b53c, 0x38c6e989), (shader_loader** out_ptr, lolix::loli::file_tree* ft));
	LOLIX_DECLARE_ITF(lxut::mod::shader_loader, lolix::itf, (0x961921cf, 0x6ea949c4, 0xbdce25b2, 0x20906faa));
	//	首先 将一个目标 attach 到里面去, mat 将会替换掉以前的　mat，　如果为空，　则仅仅表示把以前的给删除
	LOLIX_INTERFACE(attach		, lolix::LOLIX_RETNV	, (lolix::loli::file_block* data));
	LOLIX_INTERFACE(attach_tgr	, lolix::LOLIX_RETNV	, (lolix::pretty::render_material* rm, lolix::pretty::render_material** out_rm));
	//	插入一个文件头数据
	//virtual	LOLIX_RETNV	LOLIX_CALL	patch_def(memory* header)						= 0;
	//	然后开始加载数据
	//	第一个是原始资源文件的内容
	LOLIX_INTERFACE(load_src	, lolix::LOLIX_RETNV	, (lolix::loli::file_block* in_file, lolix::loli::file_block* log));

	LOLIX_INTERFACE(attrib_size	, lolix::LOLIX_RETNV	, (lolix::size_type* idx, lolix::size_type* const io_size)const);
	LOLIX_INTERFACE(attrib_local, lolix::LOLIX_RETNV	, (char name_buf[], lolix::size_type* buf_size, lolix::size_type idx)const);

	LOLIX_INTERFACE(unif_size	, lolix::LOLIX_RETNV	, (lolix::size_type* idx, lolix::size_type* const io_size)const);
	LOLIX_INTERFACE(unif_local	, lolix::LOLIX_RETNV	, (char name_buf[], lolix::size_type* buf_size, lolix::size_type idx)const);

	LOLIX_INTERFACE(tex_size	, lolix::LOLIX_RETNV	, (lolix::size_type* idx, lolix::size_type* const io_size)const);
	LOLIX_INTERFACE(tex_local	, lolix::LOLIX_RETNV	, (char name_buf[], lolix::size_type* buf_size, lolix::size_type idx)const);
};

}}


//--------------------------------------------------------------------------
//==============================================================================
#endif	//	!defined(__LXUT__MOD_SHADER_LOADER__NICK__K_IN_G__)
